![]() |
MapPoly |
||||
Header: | Quickdraw.h | Carbon status: | Supported | |
Maps and scales a polygon within one rectangle to another rectangle.
void MapPoly ( PolyHandle poly, const Rect *srcRect, const Rect *dstRect );
A handle to a polygon. Upon input, this is the polygon to map. Upon completion, this polygon is the one mapped to a new location.
The rectangle containing the polygon.
The rectangle in which the new region will be mapped.
The MapPoly function takes a polygon within one rectangle and maps and scales it to another rectangle. In the poly parameter, you specify a handle to a polygon that lies within the rectangle that you specify in the srcRect parameter. By calling the MapPt function to map all the points that define the polygon specified in the poly parameter, MapPoly maps and scales it to the rectangle that you specify in the dstRect parameter. The MapPoly function returns the result in the polygon whose handle you initially passed in the poly parameter.
Similar to the MapRgn function described in the previous section, the MapPoly function is useful for determining whether a polygon operation will exceed available memory.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)